package com;

import org.apache.log4j.Logger;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Properties;


public class Config {
    private static Logger Log=Logger.getLogger(Config.class.getName());

    public static String configFilename = "/config.properties";
    public static String db_url = null;
    public static String db_username = null;
    public static String db_password = null;

    public static String title = null;

    static {
        try {
            Properties properties = new Properties();
            InputStream in = Config.class.getResourceAsStream(configFilename);
            properties.load(in);
            in.close();
            db_url = properties.getProperty("db_url","jdbc:mysql:///eweb?useUnicode=true&characterEncoding=utf-8");
            db_username = properties.getProperty("db_username","root");
            db_password = properties.getProperty("db_password","youotech");

            title = properties.getProperty("title","zweb");

        } catch (IOException e) {
            Log.error("加载配置文件出错",e);
        }

    }


}
